//  @ Project : SPPager
//  @ File Name : SPPagerExtension.cs
//  @ Date : 2013/6/5
//  @ Author : yubaolee(.cpp)
//  @ Description: HtmlHelper extension methods
//                 general html:@Html.HtmlPager(Model, new PageOption {  })
//                 ajax html: @Html.AjaxPager(Model, new PageOption { }, new AjaxOptions { UpdateTargetId = "mainpage" })

using System.Web.Mvc;
using System.Web.Mvc.Ajax;
namespace LYB.NET.SPPager
{
    public static class SPPagerExtension
    {
        //create mvchtmlstring with general html
        public static MvcHtmlString HtmlPager(this HtmlHelper html, IPageList pagelist, PageOption option)
        {
            IBuilder builder = new HtmlHelperBuilder(html, pagelist, option);
            return builder.RenderPage();
        }

        //create mvchtmlstring with ajax
        public static MvcHtmlString AjaxPager(this HtmlHelper html, IPageList pagelist, PageOption option, AjaxOptions ajaxoption)
        {
            IBuilder builder = new MvcHelperBuilder(html, pagelist, option, ajaxoption);
            return builder.RenderPage();
        }
    }
}